<?php
declare(strict_types=1);

namespace LowCode\Naive;

use LowCode\Naive;
use LowCode\Support\JsExp;
use LowCode\Traits\Props\HasType;

/**
 * 文字渐变组件 GradientText
 * @method static static make(mixed $children = null) GradientText组件
 */
class GradientText extends Naive
{
    use HasType;
    public function __construct(mixed $children = null)
    {
        parent::__construct();
        $this->children($children);
    }

    /**
     * 渐变文字的类型
     * @param string|JsExp $type 'primary' | 'info' | 'success' | 'warning' | 'error'
     * @return $this
     */
    public function type(string|JsExp $type = 'primary' | 'info' | 'success' | 'warning' | 'error'): static
    {
        return $this->prop('type', $type);
    }

    /**
     * 文字大小（当不指定单位时，默认单位: px）
     * @param string|int|JsExp $size
     * @return $this
     */
    public function size(string|int|JsExp $size): static
    {
        return $this->prop('size', $size);
    }

    /**
     * 文字渐变色参数
     * @param string|array|JsExp $gradient string | ["from"=>"", to=>"", deg=>"" ]
     * @return $this
     */
    public function gradient(string|array|JsExp $gradient): static
    {
        return $this->prop('gradient', $gradient);
    }

}
